import { PageModel } from './common';

class ItemsMessageModel {
  public items: MessageModel[];
  public count: number;
}

class MessageOperationResultModel {
  public result: string;
  public resultNotes: string;
}

class MessageReceiversModel {
  public receiverUrn: string;
  public receiverType: number;
  public userBasicInfo: MessageUserBasicInfoModel;
}

class MessageModel {
  public id: string;
  public enclosures: BoxEnclosuresModel[];
  public messageType: number;
  public title: string;
  public accountId: string;
  public projectId: string;
  public messageBody: string;
  public sender: string;
  public userBasicInfo: MessageUserBasicInfoModel;
  public level: string;
  public tag: string;
  public receivers: MessageReceiversModel[];
  public createAt: number;
  public unread: boolean;
  public operationResult: MessageOperationResultModel;
  public updateAt: number;
  public projectName: string;
  public accountName: string;
}

class BoxEnclosuresModel {
  public resourceUrn: string;
  public resourceOwner: string;
  public resourceName: string;
}

class MessageUserBasicInfoModel {
  public realName: string;
  public email: string;
  public phoneNumber: string;
}

class MessagePageModel extends PageModel {
  public data: ItemsMessageModel;
}

export {
  MessageModel,
  MessagePageModel
};
